<%@page import="cn.jhc.dao.ConnectionFactory"%>
<%@page import="cn.jhc.dao.AnnouncementDAO"%>
<%@page import="cn.jhc.bean.NewsBean"%>
<%@page import="cn.jhc.bean.UserBean"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="./css/login.css" />
<title>用户登录</title>
</head>
<script language="javascript">
	function fsubmit(obj) {
		obj.submit();
	}
</script>
<style type="text/css">
</style>
<body>
	<div id="top">
	</div>
	<div id="wel">欢迎来到蓝调吉他社</div>
	<div id="wrapper">
		<div id="wrapperRight">
			<div id="formtitle">账号登陆</div>
			<div id="loginform">
				<form name="form" method="post" action="./loginaction.do">
					<div class="form-label">
						<label for="username"> 用户名:</label>
					</div>
					<div class="form-input">
						<%
							String getb = (String) request.getParameter("getb");
							request.setAttribute("getb", getb);
							String id = (String) request.getParameter("id");
							request.setAttribute("id", id);
							Cookie[] cookies = request.getCookies();
							String username = "";
							if (cookies != null) {
								for (Cookie c : cookies) {
									if (c.getName().equals("username")) {
										username = c.getValue();
										break;
									}
								}
							}
						%>
						<input type="text" name="username" id="username" size="21"
							value="<%=username%>" />
					</div>
					<div class="form-label">
						<label for="password"> 密　码:</label>
					</div>
					<div class="form-input">
						<input type="password" name="password" id="password" size="21"
							value="" />
					</div>
					<div class="form-label">
						<label for="yzm"> 验证码:</label>
					</div>
					<div class="form-input">
						<div class="form-yzm">
							<input type="text" name="yzm" id="yzm" size="9" value="" />
						</div>
						<div class="form-image">
							<a href="login.jsp"><img src="image.do" /></a>
						</div>
					</div>
					<div class="remember-button">
						<input type="checkbox" name="rememberusername"
							id="rememberusername" value="1" checked="checked" />
					</div>
					<div class="remember">
						<label for="rememberusername">记住用户名</label>
					</div>
					<div class="adduser">
						<a href="addnewuser.jsp">注册</a>
					</div>
					<div class="button">
						<input type="hidden" name="getb" value="${getb}"> <input
							type="hidden" name="id" value="${id}"> <input
							type="hidden" name="page" value="1">
						<div id="login">
							<a href="javascript:fsubmit(document.form);"><img
								src="images/login.jpg" width="100"></a>
						</div>
					</div>
					<div class="forget">
						<a href="">忘记密码</a>?
					</div>
				</form>
			</div>
		</div>
		<div id="line"></div>
		<div id="wapperLeft">
			<%
			NewsBean n = new NewsBean();
			AnnouncementDAO dao = new AnnouncementDAO();
			dao.setCon(ConnectionFactory.getConnection());
			n = dao.getOneAnn();
			request.setAttribute("ann", n);
			%>
			<div id="introduction">
				<div class="title"><a>公　告</a></div>
				<div class="jianjie"><a>　　${requestScope.ann.context}</a></div>
				<div class="date"><a>${requestScope.ann.date}</a></div>
			</div>
			<div class="go_index">
				<a href="index.jsp"><img src="images/go_index.jpg" width="300"></a>
			</div>
			<div class="go_taolunqu">
				<a href="alltaolunqu.jsp"><img src="images/go_taolunqu.jpg" width="300"></a>
			</div>
		</div>
	</div>
</body>
</html>